﻿@model PagingDataSet<BarThread>
@{
    Layout = "app-list-2cols";
    Html.IncludeCss("~/Applications/Bar/Styles/app.css", ResourceRenderPriority.Last);
    Html.IncludeScript("~/Applications/Bar/Scripts/jquery.spb.bar.js", ResourceRenderPriority.Last);
    SortBy_BarThread? sortBy = ViewData.Get<SortBy_BarThread?>("sortBy", null);
    bool? isEssential = Request.QueryString.Get<bool?>("isEssential", null);
    string allSelectedClass = string.Empty; //全部是否选中样式
    string postCountSelectedClass = string.Empty;//热门是否选中样式
    string essentialSelectedClass = string.Empty;//精华是否选中样式
    if (isEssential == true)
    {
        essentialSelectedClass = "tn-tabs-selected";
    }
    else if (sortBy == SortBy_BarThread.PostCount)
    {
        postCountSelectedClass = "tn-tabs-selected";
    }
    else
    {
        allSelectedClass = "tn-tabs-selected";
    }
    var currentUser = UserContext.CurrentUser==null? 0:UserContext.CurrentUser.UserId;
}
@section ContentHeader{
    @Html.Action("_BarSubmenu", "Bar")
}
@section Aside{
    @if (currentUser > 0)
    { 
        @Html.Action("_UserData", "Bar", new { userId = UserContext.CurrentUser.UserId })
    }
    @Html.Action("_TopSections", "Bar", new { topNumber = 6, sortBy = SortBy_BarSection.ThreadAndPostCount, displayTemplate = DisplayTemplate_TopSections.Headline })
    @Html.Action("_RecommendSections", "Bar", new { topNumber = 6, recommendTypeId = "10120101", displayTemplate = DisplayTemplate_RecommendSections.Summary })
}
<div class="tn-box tn-widget tn-widget-content tn-corner-all">
    <div class="tn-box-content tn-widget-content tn-corner-all">
        <div class="tn-tabs">
            <ul id="sectionTabNavs" class="tn-tabs-nav tn-border-gray tn-border-bottom tn-helper-clearfix">
                <li class="tn-widget-content tn-border-gray tn-border-trl @allSelectedClass"><a href="@SiteUrls.Instance().BarThreadRank()">
                    全部</a> </li>
                <li class="tn-widget-content tn-border-gray tn-border-trl @postCountSelectedClass"><a href="@Html.Raw(SiteUrls.Instance().BarThreadRank(SortBy_BarThread.PostCount))">
                    热门</a> </li>
                <li class="tn-widget-content tn-border-gray tn-border-trl @essentialSelectedClass"><a href="@Html.Raw(SiteUrls.Instance().BarThreadRank(null, true))">
                    精华</a> </li>
            </ul>
            <div class="tn-tabs-panel">
                @Html.Partial("_List", Model)
            </div>
        </div>
    </div>
</div>
